<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<link rel="stylesheet" href="../statics/css/bootstrap.min.css">
<link rel="stylesheet" href="../statics/css/font-awesome.min.css">
<link rel="stylesheet" href="../statics/plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="../statics/plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../statics/css/main.css">
<script src="../statics/libs/jquery.min.js"></script>
<script src="../statics/plugins/layer/layer.js"></script>
<script src="../statics/libs/bootstrap.min.js"></script>
<script src="../statics/libs/vue.min.js"></script>
<script src="../statics/plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../statics/plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../statics/plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../js/common.js"></script>
<script type="text/javascript">
	function viewImg(url,num){
		if(url != null && url !=''){
			console.log(url)
			layer.open({
			  type: 1,
			  title: false,
			  closeBtn: 0,
			 // area: '516px',
			  skin: 'layui-layer-nobg', //没有背景色
			  shadeClose: true,
			  content: $('#imgCode'+num)
			});
			
			/* layer.open({
				  type: 2,
				  title: '图片预览',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['60%', '80%'],
				  //content: url //iframe的url
				  content:"<div style='text-align: center;margin-top: 14px;'><img src='http://localhost:8080/merchantinfo/lookImage?filePath=E:/home/pay/QRUpload/81825373/qrCode/136724.jpg' width='300' height='200'></div>"
				});  */
		}
	}
</script>
<body>
<div id="viewapp" >
	<c:if test="${empty codeList}">
		<label style="margin-left: 20px">暂无二维码</label>
	</c:if>
	<c:if test="${not empty codeList}">
		<table>
		<tr>
		<c:forEach items="${codeList}" var="code" varStatus="status" >
			<td >
				<div style="margin-left: 8px;">
				<div align="center" style="margin-top: 10px;">二维码名称：${code.codeName}</div>
				<div style="margin-top: 5px;" align="center">编号：${code.codeNo}</div>
				<div style="margin-top: 5px;">
				<img id="imgCode${status.index}" onclick="viewImg(this.src,${status.index})" style="cursor: pointer;" 
				src="<%=request.getContextPath() %>${code.saveUrl}" width="200" height="200" ></div>
				
				</div>
			</td>
			<c:if test="${status.count % 4 == 0 }">
	        	</tr>
			</c:if>
	    </c:forEach>
	    </tr>
	    </table>
	</c:if>
</div>
    

</body>
</html>